package com.ganqiang1983.dbdiff;

import java.util.Map;

import com.ganqiang1983.common.metadata.Table;
import com.ganqiang1983.dbdiff.ScheduleManager.JOB_TYPE;

/**
 * one pair for job
 * 该pair job承载了需要查询的表/字段/条件
 * 的元素据信息 即：工作内容
 */
public class Job
{

  // 流水线id，标识一个完整的流程
  // 注意：当前版本不支持pairId相同的情况，即：配置
  // 文件中有多对相同的pairId，那么就会出现异常
  private String pairId;
  // job类型：dump/sort/diff
  private JOB_TYPE type;
  // path=配置文件中设置的path路径+时间戳文件夹
  private String path;
  // key: id:schema.table value: columnlist
  private Map<String, Table> leftMap;
  private Map<String, Table> rightMap;
  // table1 condition;table2 condition
  private String leftCondition;
  private String rightCondition;
  private String leftId; // id1;id2;id1
  private String rightId; // id1;id2;id1
  // for summary
  // search left total count
  private int leftCount;
  // search right total count
  private int rightCount;
  private boolean isConsistency;
  // 文件夹别名
  private String alias;
  // 是否修改过文件夹名称
  private boolean isAlias;

  public Job()
  {

  }

  public boolean isConsistency()
  {
    return isConsistency;
  }

  public void setConsistency(boolean isConsistency)
  {
    this.isConsistency = isConsistency;
  }

  public String getPath()
  {
    return path;
  }

  public void setPath(String path)
  {
    this.path = path;
  }

  public Job(JOB_TYPE type)
  {
    this.type = type;
  }

  public int getLeftCount()
  {
    return leftCount;
  }

  public void setLeftCount(int leftCount)
  {
    this.leftCount = leftCount;
  }

  public int getRightCount()
  {
    return rightCount;
  }

  public void setRightCount(int rightCount)
  {
    this.rightCount = rightCount;
  }

  public String getLeftCondition()
  {
    return leftCondition;
  }

  public String getLeftId()
  {
    return leftId;
  }

  public void setLeftId(String leftId)
  {
    this.leftId = leftId;
  }

  public String getRightId()
  {
    return rightId;
  }

  public void setRightId(String rightId)
  {
    this.rightId = rightId;
  }

  public void setLeftCondition(String leftCondition)
  {
    this.leftCondition = leftCondition;
  }

  public String getRightCondition()
  {
    return rightCondition;
  }

  public void setRightCondition(String rightCondition)
  {
    this.rightCondition = rightCondition;
  }

  public JOB_TYPE getType()
  {
    return type;
  }

  public void setType(JOB_TYPE type)
  {
    this.type = type;
  }

  public void setPairId(String pairId)
  {
    this.pairId = pairId;
  }

  public String getPairId()
  {
    return pairId;
  }

  public Map<String, Table> getLeftMap()
  {
    return leftMap;
  }

  public void setLeftMap(Map<String, Table> leftMap)
  {
    this.leftMap = leftMap;
  }

  public Map<String, Table> getRightMap()
  {
    return rightMap;
  }

  public void setRightMap(Map<String, Table> rightMap)
  {
    this.rightMap = rightMap;
  }

  public String getAlias()
  {
    return alias;
  }

  public void setAlias(String alias)
  {
    this.alias = alias;
  }

  public boolean isAlias()
  {
    return isAlias;
  }

  public void setIsAlias(boolean isAlias)
  {
    this.isAlias = isAlias;
  }

}
